<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>精准政务审核查看</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link href="../../layui/css/iconfont/iconfont.css" rel="stylesheet" type="text/css">
    <link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <link href="../../css/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" type="text/css">
    <script src="../../layui/layui.js"></script>
    <script src="../../js/jquery-1.8.3.js"></script>
    <script src="../../js/util.js"></script>
    <script src="../../js/jquery-ui-1.10.4.custom.min.js"></script>
    <script type="text/javascript">
        layui.use(['form', 'jquery', 'element', 'laydate', 'layer'], function () {
            var form = layui.form;
            var $ = layui.$;
            var laydate = layui.laydate;
            var layer = layui.layer;
            var mgrId = getUrlParam("mgrId");
            var cityId = getUrlParam("cityId");
            laydate.render({
                elem: '#startTime'
            });
            laydate.render({
                elem: '#endTime'
            });
            $('#yes').on('click', function () {
                var param = {
                    mgrId: mgrId,
                    checkResult: "1",                    
                    checkMsg: $("#checkMsg").val()
                };
                var url = '/jzzwCheck/checkEnd';
                $.ajax({
                    type: 'post',
                    async: false,
                    url: url,
                    data: param,
                    beforeSend: function () {
                        if ($("#checkMsg").val() == "") {
                            $("#checkMsg").val("通过");
                        }
                        loading = layer.load(0, {shade: false});
                    },
                    success: function (json) { 						
    						 layer.close(loading);
                        var data = json.data;  
                               if (json.code == 0) {
                            layui.use('layer', function () {
                                layer.msg('审核成功，点击确定按钮返回审核管理界面', {
                                    time: 0 //不自动关闭
                                    , btn: ['确定']
                                    , yes: function (index) {                                    					                         
                                        layer.close(index);
                                        location.href = "jzzwCheckManage.html";
    									/* //变更同步
    									var turl = "/SmsChange/findChangeByMgrId";
    									var tparam = {
    										mgrId : mgrId
    									};
    									$.ajax({
    										type : 'post',
    										data : tparam,
    										url : turl,
    										success : function(json) {
    											console.info(json);
    										}
    									}) */
    								}
                                });
                            });
                        } else {
                            layer.msg(json.msg);
    					}   	                    
                    } ,
                    error: function (data) {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
            });

            $('#no').on('click', function () {
                var param = {
                    mgrId: mgrId,
                    checkResult: "2",
                    checkMsg: $("#checkMsg").val()
                };
                var url = '/jzzwCheck/checkEnd';
                $.ajax({
                    type: 'post',
                    async: false,
                    url: url,
                    data: param,
                    beforeSend: function () {
                        if ($("#checkMsg").val() == "") {
                            layer.msg("审核说明不能为空");
                            return false;
                        }
                        loading = layer.load(0, {shade: false});
                    },
                    success: function (json) {
                        layer.close(loading);
                        var data = json.data;
                        if (json.code == 0) {
                            layui.use('layer', function () {
                                layer.msg('审核成功，点击确定按钮返回审核管理界面', {
                                    time: 0 //不自动关闭
                                    , btn: ['确定']
                                    , yes: function (index) {                                    					                         
                                        layer.close(index);
                                        location.href = "jzzwCheckManage.html";
    									/* //变更同步
    									var turl = "/SmsChange/findChangeByMgrId";
    									var tparam = {
    										mgrId : mgrId
    									};
    									$.ajax({
    										type : 'post',
    										data : tparam,
    										url : turl,
    										success : function(json) {
    											console.info(json);
    										}
    									}) */
    								}
                                });
                            });
                        } else {
                            layer.msg(json.msg);
    					}
    				},
                    error: function (data) {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
            });

            //页面数据初始化
            $(document).ready(function () {
                var url = '/jzzwCheck/findJzzwCheckByMgrId';
                var param = {
                    mgrId: mgrId
                };
                $.ajax({
                    type: 'post',
                    async: false,
                    url: url,
                    data: param,
                    beforeSend: function () {
                        loading = layer.load(0, {shade: false});
                    },
                    success: function (json) {
                        layer.close(loading);
                        var data = json.data;
						$('#sendContent').val(data.sendContent);
						$('#cityName').val(data.cityName );
						$('#mgrName').val(data.mgrName);						
                    }
                    ,
                    error: function (data) {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
            });
        });
    </script>
</head>
<body>
<div class="layui-html-limit">
    <div class="layui-content-body">
        <div class="scroll-box">
            <div class="breadcrumb-box">
              <span class="layui-breadcrumb" lay-separator="|">
     <a href="javascript:returnIndex2()">首页&nbsp;</a>
     <a href="">&nbsp;精准政务&nbsp;</a>
     <a href="jzzwCheckManage.html">&nbsp;精准政务审核&nbsp;</a>
     <a href=""> &nbsp;精准政务审核查看&nbsp; </a>
</span>
         </div>
         <div class="content-box">
         <div class="layui-form layui-form-pane" action="">
                <div class="layui-form-item">
                        <div class="layui-block" pane="">
                            <label class="layui-form-label">归属地</label>
                            <div class="layui-input-block">
                                <input type="text" style="width:auto"
                                       id="cityName" autocomplete="off" class="layui-input" disabled>
                            </div>
                        </div>
                    </div>
                <div class="layui-form-item">
                        <div class="layui-block" pane="">
                            <label class="layui-form-label">项目名称</label>
                            <div class="layui-input-block">
                                <input type="text" style="width:auto"
                                       id="mgrName" autocomplete="off" class="layui-input" disabled>
                            </div>
                        </div>
                    </div>
							<div class="layui-form-item">
								<div class="layui-block" pane="">
									<label class="layui-form-label">短信内容</label>
									<div class="layui-input-block">
										<textarea class="layui-textarea"
											style="width: 30%" id="sendContent" disabled></textarea>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">审核说明</label>
								<div class="layui-input-block">
									<textarea placeholder="请输入内容" class="layui-textarea"
										style="width: 30%" id="checkMsg"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<button class="layui-btn layui-btn-normal" id="yes">审核通过</button>
								<button class="layui-btn layui-btn-danger" id="no">审核不通过</button>
							</div>
						</div>

					</div>
        </div>
    </div>
</div>
</div>

</body>
</html>